//
//  Tools.h
//  Teleport
//
//  Created by RLY on 2020/5/14.
//  Copyright © 2020 xxt. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface Tools : NSObject

+ (NSInteger)timeInterval;

+ (NSString *)appVersion;
+ (NSString *)appName;

+ (BOOL)checkNumberDecimal:(NSString *)str;
+ (BOOL)checkAmountDecimal:(NSString *)str;
/**传入秒格式化时间 */
+ (NSString *)videoLengthWithSeconds:(long)seconds;
 /**字典转json字符串 */
+ (NSString *)convertToJsonString:(NSDictionary *)dict;
/**json字符串转字典 */
+ (NSDictionary *)convertToDict:(NSString *)jsonString;
/**当前VC */
+ (UIViewController *)currentViewController;
/**当前 nav */
+ (UINavigationController *)currentNavController;

+ (BOOL)isBangsScreen;
/**生成二维码图片 */
+ (void)createQRWithString:(NSString*)text QRSize:(CGSize)size finishBlock:(void (^)(UIImage *))finishBlock;
/**获取本地的头像 */
+ (UIImage *)avatarImage;
+ (void)saveAvatarImageWithUrl:(NSString *)url complete:(void (^ _Nullable )(UIImage *))complete;
/**保存头像 */
+ (void)saveAvatarImageWithImage:(UIImage *)image;

+ (BOOL)removeFileAtPath:(NSString *)path;
+ (void)removeAvatarImage;

+ (NSString *)chineseChangePinyin:(NSString *)string;

+ (void)saveImageToPhotos:(UIImage *)image;
#pragma mark   -----浮点数精度处理-----
//6位
+ (NSString *)reviseString:(NSString *)value;
//2位
+ (NSString *)CNYString:(NSString *)value;

+ (void)copyStringToPasteboard:(NSString *)string;

+ (NSString *)hiddenPhoneMiddleWithString:(NSString *)string;
// 生成一张图片
+(UIImage *)snapshotSingleView:(UIView *)view;
 

@end

NS_ASSUME_NONNULL_END
